package org.cms.entities;

import javax.persistence.*;

/**
 * Created by elnoa on 18/10/14.
 */
@Entity
@NamedQueries(value = {
        @NamedQuery(name = "getAllCheckIn", query = "select c from CheckIn c"),
        @NamedQuery(name = "getCheckInByID", query = "select c from CheckIn c where c.id=:id")
})
public class CheckIn {


    @Id
    @Column(insertable=true, updatable=true, unique=true, nullable=false)
    private String id;

    @Column
    private String type;
    @Column
    private Boolean isPrivate;

//    @OneToOne(optional = true)
//    @JoinColumn(name = "id")
//    private FourSqUser user;

    @Column
    private String timeZone;

    @OneToOne(fetch=FetchType.LAZY, optional = true, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
    @JoinColumn(name = "venue_id")
    private Venue venue;

    @Column
    private String shout;

    @Column
    private Long createdAt;
    //private Source source;

    @Column
    private String comments;
    //private CheckinGroup overlaps;



    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Boolean getIsPrivate() {
        return isPrivate;
    }

    public void setIsPrivate(Boolean isPrivate) {
        this.isPrivate = isPrivate;
    }

//    public FourSqUser getUser() {
//        return user;
//    }
//
//    public void setUser(FourSqUser user) {
//        this.user = user;
//    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public Venue getVenue() {
        return venue;
    }

    public void setVenue(Venue venue) {
        this.venue = venue;
    }

    public String getShout() {
        return shout;
    }

    public void setShout(String shout) {
        this.shout = shout;
    }

    public Long getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Long createdAt) {
        this.createdAt = createdAt;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }
}
